package com.example.myapplication;

import static android.content.ContentValues.TAG;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class FitstActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fitst);
        Log.e(TAG,"Activity__"+getTaskId());
        Button btn = findViewById(R.id.button1);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //显示启动
                Intent intent = new Intent(FitstActivity.this,iPhone.class);
                startActivity(intent);
            }
        });
        Button btn2 = findViewById(R.id.button2);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //隐示启动
                Intent intent = new Intent("android.intent.action.iPhone");
                startActivity(intent);
            }
        });
        Button btn3 = findViewById(R.id.button3);
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //启动系统自带的电话
                Intent intent = new Intent();
                intent.setAction(Intent.ACTION_DIAL);
                intent.setData(Uri.parse("tel:10086"));
                startActivity(intent);
            }
        });

    }
    //生命周期
    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG,"mainActivity_onStart");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG,"mainActivity_onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG,"mainActivity_onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d(TAG,"mainActivity_onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(TAG,"mainActivity_onDestroy");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d(TAG,"mainActivity_onRestart");
    }
}
